<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::get("/index", "index/Index/index");
Route::get("/checkSignature", "index/Index/checkSignature");
// 后台
Route::group('api/admin', function () {
    Route::post('/login', 'admin/staff.staff/login')->name("系统模块/登录");

    Route::post('/loginOut', 'admin/staff.staff/loginOut')->name("系统模块/登出")->middleware("checkToken");

    // 人员
    Route::group('/staff', function () {
        Route::post("/info", 'admin/staff.staff/info')->name("系统模块/客服信息");
        Route::post("/update_info", 'admin/staff.staff/updateInfo')->name("系统模块/客服信息上传");
    })->middleware("checkToken");

    // 系统权限
    Route::group('/manage', function () {
        Route::post("/role/role_list_data", 'admin/manage.role/roleListData')->name("系统模块/权限数据");
        Route::post("/role/role_list_data_url", 'admin/manage.role/roleListDataUrl')->name("系统模块/权限URL");
    })->middleware(["checkToken", "permission"]);
    Route::post("/staff/list", "admin/manage.Staff/staffList")->name("管理模块/客服管理/客服列表")->middleware(["checkToken", "permission"]);
    Route::post("/staff/online/list","admin/manage.Staff/staffOnlineList")->name("管理模块/客服管理/客服在线列表");
    Route::post("/staff/status_up", "admin/manage.Staff/StaffAllStatus")->name("管理模块/客服管理/状态修改")->middleware(["checkToken", "permission"]);
    Route::post("/staff/on_status_list", "admin/manage.Staff/getOnStatus")->name("管理模块/客服管理/状态列表")->middleware(["checkToken", "permission"]);
    // 管理
    Route::group('/manage', function () {
        Route::post("/reply/add_cate", 'admin/manage.info/addCate')->name("管理模块/回复分类/添加分类");
        Route::post("/reply/up_cate", 'admin/manage.info/upCate')->name("管理模块/回复分类/修改分类");
        Route::post("/reply/del_cate", 'admin/manage.info/delCate')->name("管理模块/回复分类/删除分类");
        Route::post("/reply/li_cate", 'admin/manage.info/liCate')->name("管理模块/回复分类/分类列表");

        Route::post("/reply_info/add_info", 'admin/manage.info/addInfo')->name("管理模块/回复信息/添加回复");
        Route::post("/reply_info/up_info", 'admin/manage.info/upInfo')->name("管理模块/回复信息/修改回复");
        Route::post("/reply_info/del_info", 'admin/manage.info/delInfo')->name("管理模块/回复信息/删除回复");
        Route::post("/reply_info/li_info", 'admin/manage.info/liInfo')->name("管理模块/回复信息/消息列表");
        Route::post("/reply_info/det_info", 'admin/manage.info/detInfo')->name("管理模块/回复信息/消息详情");
        Route::post("/reply_info/li_my_info", 'admin/manage.info/liMyInfo')->name("管理模块/回复信息/个性列表");


        Route::post("/rule/det_rule", 'admin/manage.rule/detRule')->name("管理模块/分配规则/规格详情");
        Route::post("/rule/save_rule", 'admin/manage.rule/saveRule')->name("管理模块/分配规则/规格保存");


        Route::post("/role/role_list", 'admin/manage.role/roleList')->name("管理模块/权限功能/权限列表");
        Route::post("/role/add_role", 'admin/manage.role/addRole')->name("管理模块/权限功能/添加权限");
        Route::post("/role/role_duty_list", 'admin/manage.role/roleDutyList')->name("管理模块/权限功能/角色列表");

        Route::post("/sword/list_word", 'admin/manage.sword/listWord')->name("管理模块/权限功能/敏感列表");
        Route::post("/sword/add_word", 'admin/manage.sword/addWord')->name("管理模块/权限功能/敏感添加");
        Route::post("/sword/up_word", 'admin/manage.sword/upWord')->name("管理模块/权限功能/敏感修改");
        Route::post("/sword/del_word", 'admin/manage.sword/delWord')->name("管理模块/权限功能/敏感删除");

        Route::post("/team/method_add", 'admin/manage.Team/methodAdd')->name("管理模块/客服管理/排班添加");
        Route::post("/team/method_list", 'admin/manage.Team/methodList')->name("管理模块/客服管理/排班列表");
        Route::post("/team/method_up", 'admin/manage.Team/methodUp')->name("管理模块/客服管理/排班修改");
        Route::post("/team/method_del", 'admin/manage.Team/methodDel')->name("管理模块/客服管理/排班删除");

        Route::post("/team/method_set_list", 'admin/manage.Team/methodSetList')->name("管理模块/客服管理/分组列表");
        Route::post("/team/method_set", 'admin/manage.Team/methodSet')->name("管理模块/客服管理/分组设置");


    })->middleware(["checkToken", "permission"]);

    // 聊天
    Route::group('/chat', function () {
        Route::post('/ws_bind', 'admin/staff.wsLogin/wsBind')->name("聊天模块/ws绑定");
        Route::post('/user_list', 'admin/chat.UserList/userList')->name("聊天模块/用户列表");
        Route::post('/staff_news', 'admin/chat.UserList/staffNews')->name("聊天模块/客服消息");
        Route::post('/send_info', 'admin/chat.UserList/sendInfo')->name("聊天模块/发送消息");
        Route::post('/get_info', 'admin/chat.UserList/getInfo')->name("聊天模块/获取消息");
        Route::post('/up_info_status', 'admin/chat.UserList/upInfoStatus')->name("聊天模块/客服修改消息状态");
        Route::post('/make_sign', 'admin/chat.UserList/makeSign')->name("聊天模块/用户标星");
        Route::post('/user_info', 'admin/chat.UserList/userInfo')->name("聊天模块/用户信息");
        Route::post('/save_user_info', 'admin/chat.UserList/saveUserInfo')->name("聊天模块/保存用户");
        Route::post('/pv_list', 'admin/chat.UserList/pvList')->name("聊天模块/浏览记录");

        Route::post('/add_my', 'admin/chat.FastReply/addMy')->name("聊天模块/我的消息添加");
        Route::post('/up_my', 'admin/chat.FastReply/upMy')->name("聊天模块/我的消息修改");
        Route::post('/del_my', 'admin/chat.FastReply/delMy')->name("聊天模块/我的消息删除");
        Route::post('/tree_list', 'admin/chat.FastReply/treeList')->name("聊天模块/消息列表树");
        Route::post("/auto_my", 'admin/chat.FastReply/autoMy')->name("聊天模块/我的消息自动");
        Route::post("/reply_auto_set", 'admin/chat.FastReply/replyAutoSet')->name("聊天模块/自动回复");

        Route::post('/to_staff', 'admin/chat.UserList/toStaff')->name("聊天模块/客户转让");
        Route::post('/staff_status', 'admin/chat.UserList/staffStatus')->name("聊天模块/修改客服状态");
        Route::post('/staff_chat_set', 'admin/chat.UserList/staffChatSet')->name("聊天模块/结束对话");

    })->middleware("checkToken");
    // 日志
    Route::group('/log', function () {
        Route::post('/login', 'admin/logAction.log/loginLog')->name("日志模块/登录日志");
        Route::post('/action', 'admin/logAction.log/actLog')->name("日志模块/操作日志");
    })->middleware("checkToken");

    // 数据
    Route::group('/data_center', function () {
        Route::post('/user_card_list', 'admin/dataCenter.user/userCardList')->name("数据模块/名片列表");
        Route::post('/user_card_list_excel', 'admin/dataCenter.user/userCardListExcel')->name("数据模块/名片列表导出");
        Route::post('/chat_log_list', 'admin/dataCenter.user/chatLogList')->name("数据模块/聊天记录");
        Route::post('/chat_list', 'admin/dataCenter.user/chatList')->name("数据模块/聊天列表");
        Route::post('/chat_tj', 'admin/dataCenter.user/chatTj')->name("数据模块/对话统计");
        Route::post('/vis_list', 'admin/dataCenter.user/visList')->name("数据模块/访客列表");
        Route::post('/vis_list_excel', 'admin/dataCenter.user/visListExcel')->name("数据模块/访客列表导出");
        Route::post('/chat_t', 'admin/dataCenter.user/chatT')->name("数据模块/客服对话统计");
        Route::post('/chat_t_excel', 'admin/dataCenter.user/chatTExcel')->name("数据模块/客服对话统计导出");
    })->middleware("checkToken");

    //
    Route::group('/index', function () {
        Route::post("/new_day", "admin/index.Overview/newDay")->name("首页模块/首页概览");
        Route::post("/operate", "admin/index.Overview/operate")->name("首页模块/首页运营");
        Route::post("/source_tj", "admin/index.Overview/sourceTJ")->name("首页模块/访客百分比");
        Route::post("/source_num", "admin/index.Overview/sourceNum")->name("首页模块/访客数量");
    })->middleware("checkToken");

    //
    Route::group('/sys_set', function () {
        Route::post("/hint/list", "admin/sysSet.Hint/list")->name("系统设置/对话提示/对话列表");
        Route::post("/hint/up", "admin/sysSet.Hint/up")->name("系统设置/对话提示/对话修改");
        Route::post("/hint/del", "admin/sysSet.Hint/del")->name("系统设置/对话提示/对话删除");
        Route::post("/hint/stat", "admin/sysSet.Hint/stat")->name("系统设置/对话提示/状态修改");
    })->middleware("checkToken");

    //虚拟
    Route::group('/virtual', function () {
        Route::post("/push_store/list", "admin/virtual.PushStore/list")->name("虚拟/店铺推广/店铺列表");
        Route::post("/push_store/add", "admin/virtual.PushStore/add")->name("虚拟/店铺推广/店铺添加");
        Route::post("/push_store/del", "admin/virtual.PushStore/del")->name("虚拟/店铺推广/店铺删除");
        Route::post("/push_store/get_gw_shop_checked", "admin/virtual.PushStore/getGwShopCheckedId")->name("虚拟/店铺推广/获取官网转店的审核状态");

        Route::post("/push_store_rule/list", "admin/virtual.PushStoreRule/list")->name("虚拟/店铺推广/规则列表");
        Route::post("/push_store_rule/add", "admin/virtual.PushStoreRule/add")->name("虚拟/店铺推广/规则添加");
        Route::post("/push_store_rule/del", "admin/virtual.PushStoreRule/del")->name("虚拟/店铺推广/规则删除");

        Route::post("/class_qu/list", "admin/virtual.ClassQu/list")->name("虚拟/问题分类/列表");
        Route::post("/class_qu/add", "admin/virtual.ClassQu/add")->name("虚拟/问题分类/添加");
        Route::post("/class_qu/del", "admin/virtual.ClassQu/del")->name("虚拟/问题分类/删除");
        Route::post("/class_qu/up", "admin/virtual.ClassQu/up")->name("虚拟/问题分类/修改");

        Route::post("/qu/list", "admin/virtual.Qu/list")->name("虚拟/常见问题/列表");
        Route::post("/qu/add", "admin/virtual.Qu/add")->name("虚拟/常见问题/添加");
        Route::post("/qu/del", "admin/virtual.Qu/del")->name("虚拟/常见问题/删除");
        Route::post("/qu/up", "admin/virtual.Qu/up")->name("虚拟/常见问题/修改");

        Route::post("/robot_set/get_set", "admin/virtual.RobotSet/getSet")->name("虚拟/设置/详情");
        Route::post("/robot_set/add_set", "admin/virtual.RobotSet/addSet")->name("虚拟/设置/保存");

        Route::post("/robot_action/get_act", "admin/virtual.RobotAction/getAct")->name("虚拟/行为/获取");
        Route::post("/robot_action/add_act", "admin/virtual.RobotAction/addAct")->name("虚拟/行为/保存");
    })->middleware("checkToken");


    /**
     * 举报相关
     */
    Route::group('report',function (){
        Route::get("index",'admin/dataCenter.report/index')->name("举报列表");//举报列表
    });
});

// 公共数据
Route::group('api/common', function () {
    Route::post('/staff_list', 'admin/common.ListData/getStaffList')->name("公共数据/客服列表");
    Route::post("/dict_list", "admin/common.ListData/getDictList")->name("公共数据/字典列表");
    Route::post("/duty_list", "admin/common.ListData/getDutyList")->name("公共数据/职位列表");
})->middleware("checkToken");

//Route::post('/pxs/ws_bind', 'pxs/wsLogin/wsBind')->name("官网ws绑定");
//Route::post('/pxs/send_info','pxs/user/sendInfo')->name("客服发送消息");

// 铺先生 获取token
Route::post('api/pxs/get_token', "pxs/User/getToken")
    ->name("官网模块/获取token");
//->middleware("requestTime")

// 铺先生
Route::group('api/pxs', function () {
    Route::post('/ws_bind_cry', 'pxs/wsLogin/wsBindCry')->name("官网模块/官网ws绑定");
    Route::post('/send_info_cry', 'pxs/User/sendInfoToStaffCry')->name("官网模块/客户发送消息");
    Route::post('/get_info_cry', 'pxs/User/getInfoCry')->name("官网模块/获取聊天消息");
    Route::post('/up_info_status_cry', 'pxs/User/upInfoStatusCry')->name("官网模块/修改消息状态");
    Route::post('/add_store_cry', 'pxs/User/addStoreCry')->name("官网模块/添加店铺信息");
    Route::post('/add_user_log_cry', 'pxs/User/addUserLogCry')->name("官网模块/添加店铺记录");

    Route::post('/get_staff_be', 'pxs/User/getStaffBe')->name("官网模块/获取售前客服");
    Route::post('/get_staff_af', 'pxs/User/getStaffAf')->name("官网模块/获取售后客服");
    Route::post('/staff_list', 'pxs/User/staffList')->name("官网模块/获取客服列表");
    Route::post('/message_board', 'pxs/User/messageBoard')->name("官网模块/客户留言");


    Route::post('/get_hot_title', 'pxs/User/getHotTitle')->name("官网模块/热门标签");
    Route::post('/get_store', 'pxs/User/getStore')->name("官网模块/获取门店");
    Route::post('/get_qu_class', 'pxs/User/getQuClass')->name("官网模块/常见问题");
    Route::post('/get_qu', 'pxs/User/getQu')->name("官网模块/获取答案");

    /**
     * 举报相关
     */
    Route::group('report',function (){
        Route::post("create",'pxs/report/create');//创建举报
    });

})->middleware("checkOtherToken");

Route::post('api/pxs/get_chat_num', 'pxs/User/getChatNum')->name("官网模块/未读消息");

Route::group('api/pxs', function () {
    Route::post('api/pxs/up_sto_status', 'pxs/User/upStatus')->name("官网模块/修改店铺状态");
    Route::post('api/pxs/add_sto', 'pxs/User/addSto')->name("官网模块/添加店铺");
})->middleware("checkEncry");

// 手机客服mobile web
Route::post('/api/mweb/bing_qye_staff', 'mweb/staff/bingQyeStaff')->name("手机模块/企业微信与客服绑定");
Route::group('api/mweb', function () {
    Route::post('/ws_bind', 'mweb/ws/wsBind')->name("手机模块/ws绑定");
    Route::post('/user_list', 'mweb/staff/userList')->name("手机模块/客户列表");
    Route::post('/send_info', 'mweb/chat/sendInfo')->name("手机模块/发送消息");
    Route::post('/get_info', 'mweb/chat/getInfo')->name("手机模块/获取消息");
    Route::post('/up_info_status', 'mweb/chat/upInfoStatus')->name("手机模块/修改消息状态");
    Route::post('/to_staff', 'mweb/staff/toStaff')->name("手机模块/客户转让");
    Route::post('/staff_status', 'mweb/staff/staffStatus')->name("手机模块/修改客服状态");
    Route::post('/pv_list', 'mweb/user/pvList')->name("手机模块/浏览记录");
    Route::post('/get_reply_list', 'mweb/fastReply/getInfoList')->name("手机模块/快回列表");
    Route::post('/get_self_reply_list', 'mweb/fastReply/getSelfInfoList')->name("手机模块/个性列表列表");
    Route::post('/staff_news', 'mweb/staff/staffNews')->name("手机模块/客服消息");
})->middleware("checkWxToken");

return [

];
